<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.commons.lang3.StringEscapeUtils" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<html>
<head>
    <script type="text/javascript" src="${ctxStatic}/aliimg/lib/crypto1/crypto/crypto.js"></script>
	<script type="text/javascript" src="${ctxStatic}/aliimg/lib/crypto1/hmac/hmac.js"></script>
	<script type="text/javascript" src="${ctxStatic}/aliimg/lib/crypto1/sha1/sha1.js"></script>
	<script type="text/javascript" src="${ctxStatic}/aliimg/lib/base64.js"></script>
	<script type="text/javascript" src="${ctxStatic}/aliimg/lib/plupload-2.1.2/js/plupload.full.min.js"></script>
	<script type="text/javascript" src="${ctxStatic}/aliimg/upload.js"></script>
	<link rel="stylesheet" type="text/css" href="${ctxStatic}/aliimg/style.css"/>
	<title>工程单据管理</title>
	<meta name="decorator" content="default"/>
	<%
		Object optObj = request.getAttribute("opt");
		String opt = null;
		if(optObj!=null){
			opt = (String)optObj;
		}
		if(opt!=null && opt.equals("detail")){ 
	%>
	 <script type="text/javascript">
		$(document).ready(function() {
			$(this).find("input").each(function() {
				$(this).attr("disabled", "disabled");
				}); 
			$(this).find("select").each(function() {
				$(this).attr("disabled", "disabled");
				});
		});
	</script>
	 <%
	 	}else{
	 %>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
	<%}%>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/bill/bizProjectBill/ytt/form?id=${bizProjectBill.id}">工程单据<shiro:hasPermission name="bill:bizProjectBill:edit">${not empty bizProjectBill.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="bill:bizProjectBill:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="bizProjectBill" action="${ctx}/bill/bizProjectBill/ytt/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">工程中心编码：</label>
			<div class="controls">
				<form:input path="id" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"></span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工程中心名称：</label>
			<div class="controls">
				<form:input path="proName" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"></span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">运行模式：</label>
			<div class="controls">
				<form:select path="proType" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('proType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">申请类型：</label>
			<div class="controls">
				<form:select path="billType" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('billType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">所属地区：</label>
			<div class="controls">
				<form:select path="provinceId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getProvinceList()}" itemLabel="provinceName" itemValue="id" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">行业领域：</label>
			<div class="controls">
				<form:select path="categoryId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('category_id')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">细分行业领域：</label>
			<div class="controls">
				<form:select path="subCategoryId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('sub_category_id')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">拟开工时间：</label>
			<div class="controls">
				<input name="proStartTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${bizProjectBill.proStartTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">拟建成时间：</label>
			<div class="controls">
				<input name="proEndTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${bizProjectBill.proEndTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">审核内容：</label>
			<div class="controls">
				<% 
				if(opt!=null && opt.equals("detail")){ 
						%>
						${bizProjectBill.explainContent}						
						<%
					}else{
						%>
						<form:textarea id="explainContent" htmlEscape="true" path="explainContent" rows="4" maxlength="200" class="input-xxlarge"/>
						<sys:ckeditor replace="explainContent" uploadPath="/cms/article" />
						<%
					}
				%>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">主管单位负责人：</label>
			<div class="controls">
				<form:select path="responserId" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<form:input path="responserTelNo" htmlEscape="false" maxlength="64" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">工程中心负责人：</label>
			<div class="controls">
			</div>
		</div>
		
		
		<div class="form-actions">
			<shiro:hasPermission name="bill:bizProjectBill:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>